#ifndef SHADER_CLASS_H
#define SHADER_CLASS_H

#include "OpenGLDef.h"

namespace OCPP
{
	std::string get_file_contents(String filename);

	class _openGLExport Shader
	{
	public:
		// Reference ID of the Shader Program
		uint32 ID;
		// Constructor that build the Shader Program from 2 different shaders
		Shader();
		~Shader();

		bool valid() { return mLoaded; }
		void load(String vertexFile, String fragmentFile,String geomFile = "");

		void setUniform1f(String name, float value);
		void setUniform1i(String name, uint32 value);
		
		void setUniform3fv(String name, const Vector3& value);
		void setUniform4fv(String name, const Vector4& value);
		void setUniformMatrix4fv(String name, const Matrix4& value);
		void setUniformMatrix4fv(String name, const glm::mat4& value);
		// Activates the Shader Program
		void Activate();
	private:
		// Checks if the different Shaders have compiled properly
		void compileErrors(unsigned int shader, const char* type);

		bool mLoaded = false;
	};
}
#endif